package com.kgdev.cweb.entities.prod.owned.client;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import com.kgdev.cweb.entities.prod.managed.Client;

/**
 * The persistent class for the shipping database table.
 * 
 */
@Entity
@Table(name = "prod_client_shipinf")
public class ClientShippingInfo implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@TableGenerator(name = "PROD_CLN_SI", allocationSize = 1, initialValue = 1, table = "SEQUENCE", 
	valueColumnName = "SEQ_COUNT", pkColumnName = "SEQ_NAME", pkColumnValue = "PROD_CLN_SI")
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "PROD_CLN_SI")
	@Column(name = "shipping_id", unique = true, nullable = false)
	private Integer shippingId;

	@Column(name = "shipping_address", length = 45)
	private String shippingAddress;
	
	@Column(name = "is_active")
	private Boolean isActive;
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((shippingId == null) ? 0 : shippingId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ClientShippingInfo other = (ClientShippingInfo) obj;
		if (shippingId == null) {
			if (other.shippingId != null)
				return false;
		} else if (!shippingId.equals(other.shippingId))
			return false;
		return true;
	}

	public Boolean getIsActive() {
		return isActive;
	}

	public void setIsActive(Boolean isActive) {
		this.isActive = isActive;
	}

	@ManyToOne
	@JoinColumn(name = "client_id")
	private Client client;
	
	public Client getClient() {
		return client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	public ClientShippingInfo() {
	}

	public Integer getShippingId() {
		return this.shippingId;
	}

	public void setShippingId(Integer shippingId) {
		this.shippingId = shippingId;
	}

	public String getShippingAddress() {
		return shippingAddress;
	}

	public void setShippingAddress(String shippingAddress) {
		this.shippingAddress = shippingAddress;
	}

}